<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh-CN" class="ie8"> <![endif]-->
<html lang="zh-CN">

	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>订单列表</title>
		<meta content="telephone=no,email=no,address=no" name="format-detection" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="msapplication-tap-highlight" content="no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="wap-font-scale" content="no">
		<meta name="Keywords" content="" />
		<meta name="Description" content="" />

		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/User/css/common.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/User/css/user.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/User/css/color-style.css" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc_moblie/Public/css/public.css">
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Shop/css/dropload.css" />
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/User/js/area/jquery.min.js"></script>
		<script type="text/javascript" src="/themes/wnsc_moblie/Public/js/common.js"></script>
		<script src="/themes/wnsc_moblie/newMobile/Shop/css/dropload.js"></script>
		<script src="/themes/wnsc_moblie/newMobile/Shop/js/layer.js"></script>
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/User/js/flexible.js"></script>
		<script src="/themes/wnsc_moblie/newMobile/User/js/iscroll.js"></script>
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/User/js/navbarscroll.js"></script>
		<link rel="stylesheet" href="/themes/wnsc_moblie/Public/layui/css/layui.css">
		<script src="/themes/wnsc_moblie/Public/layui/layui.js"></script>
		<style type="text/css">
				.wrapper02 {position:relative;height: 2rem;width: 100%;overflow: hidden;margin:0 auto;background:#fff}
				.wrapper02 .scroller {position:absolute}
				.wrapper02 .scroller li {height: 2rem;color:#333;float: left;line-height: 2rem;font-size: .4rem;text-align: center}
				.wrapper02 .scroller li a{color:#333;display:block;margin:0 .7rem}
				.wrapper02 .scroller li.cur a{color: #f23030;border-bottom: 2px solid #f23030;padding-bottom: 2px; height: 90%;}
				.no-data-div{display: none;}
		</style>
	</head>

	<body>
	<?php
				$agent = $_SERVER['HTTP_USER_AGENT'];
				if(strpos($agent,"Html5Plus") === false){
			?>
		<header>
			<div class="tab_nav">
				<div class="header">
					<div class="header-left">
						<a class="sb-back" href="javascript:history.back(-1)" title="返回"></a>
					</div>
					<div class="header-middle">

						订单列表

					</div>
					<div class="header-right">
						<aside class="show-menu-btn">
							<div class="show-menu" id="show_more">
								<a href="javascript:void(0)"></a>
							</div>
						</aside>
					</div>
				</div>
			</div>
		</header>
			<mtc_include file="Public:right_nav" />
	<?php
				}
			?>
		<div class="order-box">
			<div class="wrapper02" id="nav_list">
				<div class="scroller">
					<ul class="clearfix" >
						<li data="0"><a href="javascript:void(0)" id='order_all' >全部({$cccount})</a></li>
						<li data="1"><a href="javascript:void(0)" id='order_unpayed' >待付款({$wcount})</a></li>
						<li data="2"><a href="javascript:void(0)" id='order_unevaluate'>待拼单({$dptount})</a></li>
						<li data="3"><a href="javascript:void(0)" id='order_unshipped' >待发货({$dfcount})</a></li>
						<li data="4"><a href="javascript:void(0)" id='order_shipped' >待收货({$dscount})</a></li>
						<li data="5"><a href="javascript:void(0)" id='order_unevaluate' >待评价({$dpcount})</a></li>
					
					</ul>
				</div>
			</div>
			<script type="text/javascript">
				$(function(){
					$('#nav_list').navbarscroll({
						defaultSelect:{$_GET['status']|default='0'} ,
						endClickScroll:function(obj){
							console.log(obj.attr('data'));
							var k=obj.attr('data');
							$('.tablelist-append').hide();
							$('.show'+k).show();
							get_order_list(k);
							$('.dropload-down').remove();
						}
					});
				});
			</script>

			<div class="order-center-content" id="table_list">
				<div class="tablelist-append show0">
					<!--全部-->
					<div id="list">
						<div class="no-data-div">
							<div class="no-data-img">
								<img src="/themes/wnsc_moblie/Public/images/bg_empty_list.png">
							</div>
							<dl>
								<dt>您还没有相关的订单</dt>
								<dd>可以去看看哪些想买的</dd>
							</dl>
							
							<a href="/" class="no-data-btn">立即去购买</a>
							
						</div>
					</div>
				</div>
				<div class="tablelist-append show1">
					<!--待付款-->
					<div id="list">
						<div class="no-data-div">
							<div class="no-data-img">
								<img src="/themes/wnsc_moblie/Public/images/bg_empty_list.png">
							</div>
							<dl>
								<dt>您还没有相关的订单</dt>
								<dd>可以去看看哪些想买的</dd>
							</dl>
							
							<a href="/" class="no-data-btn">立即去购买</a>
							
						</div>
					</div>
				</div>
				<div class="tablelist-append show2">
					<!--待拼单-->
					<div id="list">
						<div class="no-data-div">
							<div class="no-data-img">
								<img src="/themes/wnsc_moblie/Public/images/bg_empty_list.png">
							</div>
							<dl>
								<dt>您还没有相关的订单</dt>
								<dd>可以去看看哪些想买的</dd>
							</dl>
							
							<a href="/" class="no-data-btn">立即去购买</a>
							
						</div>
					</div>
				</div>
				<div class="tablelist-append show3">
					<!--待发货-->
					<div id="list">
						<div class="no-data-div">
							<div class="no-data-img">
								<img src="/themes/wnsc_moblie/Public/images/bg_empty_list.png">
							</div>
							<dl>
								<dt>您还没有相关的订单</dt>
								<dd>可以去看看哪些想买的</dd>
							</dl>
							
							<a href="/" class="no-data-btn">立即去购买</a>
							
						</div>
					</div>
				</div>
				<div class="tablelist-append show4">
					<!--待收货-->
					<div id="list">
						<div class="no-data-div">
							<div class="no-data-img">
								<img src="/themes/wnsc_moblie/Public/images/bg_empty_list.png">
							</div>
							<dl>
								<dt>您还没有相关的订单</dt>
								<dd>可以去看看哪些想买的</dd>
							</dl>
							
							<a href="/" class="no-data-btn">立即去购买</a>
							
						</div>
					</div>
				</div>
				<div class="tablelist-append show5">
					<!--待评价-->
					<div id="list">
						<div class="no-data-div">
							<div class="no-data-img">
								<img src="/themes/wnsc_moblie/Public/images/bg_empty_list.png">
							</div>
							<dl>
								<dt>您还没有相关的订单</dt>
								<dd>可以去看看哪些想买的</dd>
							</dl>
							
							<a href="/" class="no-data-btn">立即去购买</a>
							
						</div>
					</div>
				</div>
			</div>
			<a href="javascript:void(0);" id="back-to-top" class="gotop hide">
				<img src="/themes/wnsc_moblie/Public/picture/topup.png">
			</a>
			<script>
				$(document).ready(function() {
					//首先将#back-to-top隐藏
					$("#back-to-top").addClass('hide');
					//当滚动条的位置处于距顶部1000像素以下时，跳转链接出现，否则消失
					$(function() {
						$(window).scroll(function() {
							if($(window).scrollTop() > 800) {
								$("#back-to-top").removeClass('hide');
							} else {
								$("#back-to-top").addClass('hide');
							}
						});
						//当点击跳转链接后，回到页面顶部位置
						$("#back-to-top").click(function() {
							$('body,html').animate({
								scrollTop: 0
							}, 600);
							return false;
						});
						
						$('body').on('touchstart', '.edit-order',function() { 
							var type=$(this).attr('data-type');
							var order_id=$(this).attr('data-id');
							//关闭订单
							if(type=='close_order'){
								var statu = confirm("是否确认取消订单?");   
								if(!statu){    
									return false;   
								}
								$.ajax({     
									type:'POST',     
									url:'{:U("user/close_order")}',     
									data:{order_id:order_id},    
									success:function(msg){       
										if(msg.code == 1){        
											layer.msg(msg.message);
											setTimeout(window.location.href='/user/order/status/1.html',1000)
											
										}else{        
											layer.msg(msg.message);
										}           
									},     
									error:function(){ 
										layer.msg('网络故障!');
									}         
								});
							}
							//确认订单
							if(type=='queren_get'){
								var statu = confirm("是否确认收货?");   
								if(!statu){    
									return false;   
								}
								$.ajax({
									type:"post",
									url:'{:U("user/confirm_order")}',
									data:{order_id:order_id}, 
									success:function(data){
										if(data.code==1){
											layer.msg(data.message)
											setTimeout('window.location.href="/user/order/status/4.html"',1000);
										}
										if(data.code==0){
											layer.msg(data.message)
										}
									}
								});

							}
							//立即评价
							if(type=='evaluation'){
								window.location.href='/user/reviewcommodity/id/'+order_id+'.html';
							}
						});
					});
				});

				function get_order_list(type) {
					var url = "{:U('user/ajax_getorder_list')}";
					
					var amount = 6;
					layui.use('flow', function(){
						  var $ = layui.jquery; //不用额外加载jQuery，flow模块本身是有依赖jQuery的，直接用即可。
						  var flow = layui.flow;
						  flow.load({
							elem: '.show'+type //指定列表容器
							,done: function(page, next){ //到达临界点（默认滚动触发），触发下一页
							  var lis = [];
							  	$.ajax({
									type: 'post',
									url: url,
									data: {
										page: page,
										stauts: type
									},
									dataType: 'json',
									success: function(res) {
										if(page==1&&res.content==''){
											$('.no-data-div').show();
											next(lis.join(''), page < res.pages); 
											$('.layui-flow-more').hide();
										}else{
											$('.no-data-div').hide();
											lis.push(res.content)
											next(lis.join(''), page < res.pages); 
										}
										
									
									}
								});
							 
							}
						  });
					});
				}
			</script>
		</div>
		<!--底部菜单 start-->

		<div style="height: 48px; line-height: 48px; clear: both;"></div>
		<mtc_include file="Public:footer" />
	</body>

</html>